home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / DOCPROC1.ZIP;1 / SAMP-DOC.ZIP / PASCAL.DOC < prev    next >
Encoding:
Text File  |  1992-10-26  |  30.1 KB  |  378 lines

  1.                                                                                 
  2.                                                                                 
  3.                                                                                 
  4.                                                                                 
  5.                                                                                 
  6.                                                                                 
  7.                                                                                 
  8.                                                                                 
  9.                                                                                 
  10.                                                                                 
  11.                                                                                 
  12.                                                                                 
  13.                                                                                 
  14.                    ********************************************                 
  15.                    *                                          *                 
  16.                    *                                          *                 
  17.                    *          A STUDENT APPROACH TO           *                 
  18.                    * Pascal ON AN IBM MVS/XA OPERATING SYSTEM *                 
  19.                    *                                          *                 
  20.                    *                                          *                 
  21.                    ********************************************                 
  22.                                                                                 
  23.                                                                                 
  24.                                                                                 
  25.                                                                                 
  26.                                                                                 
  27.                                                                                 
  28.                                                                                 
  29.                                                                                 
  30.                                                                                 
  31.                                                                                 
  32.                                                                                 
  33.                                                                                 
  34.                                                                                 
  35.                                                                                 
  36.                                                                                 
  37.                                                                                 
  38.                                                                                 
  39.                                                                                 
  40.                                                                                 
  41.                                                                                 
  42.                                                                                 
  43.                                                                                 
  44.                                                                                 
  45.                                                                                 
  46.                                                                                 
  47.                                                                                 
  48.                                                                                 
  49.                                                                                 
  50.                                                                                 
  51.                                                                                 
  52.                                                                                 
  53.                                                                                 
  54.                                                                                 
  55.                                                     John S. Ward                
  56.                                                        03/21/93                 
  57. EJECT                                                                           
  58.                                                                                 
  59.                                                                                 
  60.         In this handout we follow step-by-step instructions in creating         
  61.    a Pascal program.  Job Control Language (JCL) is used to demonstrate
  62.                                                                                 
  63.    file linkage as well as program execution.  For the purpose of this
  64.    handout, we assume you have successfully accessed the ISPF/PDF               
  65.    PRIMARY OPTION MENU shown below:                                             
  66.                                                                                 
  67.                 GEORGIA STATE UNIVERSITY COMPUTER CENTER                        
  68.     --------------------ISPF/PDF PRIMARY OPTION MENU-----------------------     
  69.    OPTION ===>                                                                  
  70.                                                            USER ID  -userid     
  71.     0  ISPF PARAMS -Specify terminal and user parameters   TIME     -14:42      
  72.     1  BROWSE      -Display source data or output listing  TERMINAL -3278       
  73.     2  EDIT        -Create or change source data           PF KEYS  -24         
  74.     3  UTILITIES   -Perform utility functions                                   
  75.     4  FOREGROUND  -Invoke language procedures in foreground                    
  76.     5  BATCH       -Submit job for language processing                          
  77.     6  COMMAND     -Enter TSO command or CLIST                                  
  78.     7  DIALOG TEST -Perform dialog testing                                      
  79.     8  LM UTILITIES-Perform library management utility functions                
  80.     C  CHANGE      -Display summary of changes for this release                 
  81.     T  TUTORIAL    -Display information about ISPF/PDF                          
  82.     X  EXIT        -Terminate ISPF using log and list defaults                  
  83.                                                                                 
  84.    Enter END command or PF3 to terminate ISPF.                                  
  85.                                                                                 
  86.                                                                                 
  87.                                                                                 
  88.    SECTION ONE: Creating your Pascal program.                                   
  89.                                                                                 
  90.                                                                                 
  91.                                                                                 
  92.     1.1) Enter 6 at the "OPTION ===>" prompt of the ISPF/PDF PRIMARY OPTION     
  93.          MENU, and hit return to go to TSO COMMAND PROCESSOR panel.             
  94.                                                                                 
  95.     1.2) Type CREATE at the cursor, and hit return.  Next, type your initials
  96.                                                                                 
  97.          when you are asked to "ENTER LIBRARY/APPLICATION NAME  ===>".  Hit
  98.          return, and type CNTL at the next prompt.  Press return one more
  99.                                                                                 
  100.          time when you see three asterisks displayed (press return anytime      
  101.                                                                                 
  102.          you see *** displayed).                                                
  103.                                                                                 
  104.     1.3) Use the F4 key to go back to the primary menu.  Then, enter 2 at       
  105.          the "OPTION ===>" prompt to go to the EDIT - ENTRY PANEL.              
  106.          Fill the sections of this panel as shown below:                        
  107.                                                                                 
  108. EJECT                                                                           
  109.    ------------------------- EDIT - ENTRY PANEL ---------------------------     
  110.    COMMAND ===>                                                                 
  111.                                                                                 
  112.    ISPF LIBRARY:                                                                
  113.       PROJECT ===> your userid                                                  
  114.       GROUP   ===> your initials     ===>           ===>         ===>           
  115.       TYPE    ===> CNTL                                                         
  116.       MEMBER  ===> program name    (Blank for member selection list)            
  117.                                                                                 
  118.    OTHER PARTITIONED OR SEQUENTIAL DATA SET:                                    
  119.       DATA SET NAME  ===>                                                       
  120.       VOLUME SERIAL  ===>          (If not catalogued)                          
  121.                                                                                 
  122.    DATA SET PASSWORD ===>          (If password protected)                      
  123.                                                                                 
  124.    PROFILE NAME      ===>          (Blank defaults to data set type)            
  125.                                                                                 
  126.                                                                                 
  127.           Hit return and you will see an empty file as shown below:             
  128.                                                                                 
  129.                                                                                 
  130.    EDIT --- User-id.Initial.CNTL(member) ------------- COLUMNS 001 072          
  131.    COMMAND ===>                                       SCROLL ===>PAGE           
  132.    ****** *********************** TOP OF DATA **************************        
  133.    ''''''                                                                       
  134.    ''''''                                                                       
  135.    ''''''                                                                       
  136.    ''''''                                                                       
  137.    ''''''                                                                       
  138.    ''''''                                                                       
  139.       .                                                                         
  140.       .                                                                         
  141.                                                                                 
  142.                                                                                 
  143.             Use the TAB key to move the cursor to any of the first six          
  144.        asterisks of the first line.  Next, type over one of those                
  145.        asterisks with an "I" (for insert), and hit return.  You can now         
  146.        enter your program.  New lines are generated every time you type a       
  147.        line and press return.  When you are finished entering your program,     
  148.        press return.  The absence of data followed by a return will stop
  149.        new lines from being generated.  You may prefer to use the example
  150.        below for practice purposes:                                             
  151.                                                                                 
  152. EJECT                                                                           
  153.    EDIT --- user-id.init.CNTL(PAS) ------------------------------ COLUMNS 001 07
  154.    COMMAND ===>                                                  SCROLL ===> PAG
  155.    ****** ************************* TO OF DATA *********************************
  156.    000100 //STEP1 EXEC PASCCLG                                                  
  157.    000200 PROGRAM TEST(INPFILE,OUTFILE);                                        
  158.    000300 TYPE                                                                  
  159.    000400   LINES = PACKED ARRAY (.1..80.) OF CHAR;                             
  160.    000500 VAR                                                                   
  161.    000600   INPFILE,OUTFILE : FILE OF LINES;                                    
  162.    000700 BEGIN                                                                 
  163.    000800   RESET(INPFILE);                                                     
  164.    000900   REWRITE(OUTFILE);                                                   
  165.    001000   WHILE NOT EOF(INPFILE) DO                                           
  166.    001100     BEGIN                                                             
  167.    001200       OUTFILE@ := INPFILE@;                                           
  168.    001300       PUT(OUTFILE);                                                   
  169.    001400       GET(INPFILE)                                                    
  170.    001500     END                                                               
  171.    001600 END.                                                                  
  172.    001700 //GO.INPFILE DD DSN=user-id.init.CNTL(input member),DISP=SHR          
  173.    001800 //GO.OUTFILE DD DSN=user-id.init.CNTL(output member),DISP=OLD         
  174.    ****** ************************* BOTTOM OF DATA *****************************
  175.                                                                                 
  176.                                                                                 
  177.                                                                                 
  178. EJECT                                                                           
  179.        The program above reads a character record of length eighty from         
  180.        an input file and writes it back to an output file.  In this             
  181.        program, the lines starting with "//" in columns one and two are         
  182.        JCL statements.  The first  statement compiles, links and executes       
  183.        the program.  The JCL statements that start with "//GO." link your       
  184.        input and output files to the program.  Note that for the input          
  185.        and output files, the clauses DISP=SHR, and DISP=OLD are used.            
  186.        This means that these files must already exist before the program        
  187.        can successfully execute.                                                
  188.                                                                                 
  189.                                                                                 
  190.                                                                                 
  191.        SECTION TWO: Creating input/output files:                                
  192.                                                                                 
  193.            To create the input file, go back to the EDIT - ENTRY PANEL          
  194.        by typing "=2" at the "COMMAND ===>" prompt of the current panel         
  195.        and pressing return.  Once you leave the current screen, your            
  196.        program is automatically saved.  In the EDIT panel, enter the name       
  197.        of your input file at the "MEMBER ===>" prompt and hit return.           
  198.        Enter your input data the same way you entered your program.             
  199.                                                                                 
  200.            Unlike the input member that must be created ahead of time,          
  201.        the member for the output data is created when the program is            
  202.        executed.  However the data set that houses the output member must       
  203.        already exist before the program is executed.  You have already          
  204.        constructed this data set when you used the CREATE command.              
  205.                                                                                 
  206.                                                                                 
  207.                                                                                 
  208.                                                                                 
  209.    SECTION THREE: Executing your Pascal program.                                
  210.                                                                                 
  211.                                                                                 
  212.                                                                                 
  213.      3.1) To execute your program, enter =2 at the "COMMAND ===>" prompt.       
  214.           Press return to go to the EDIT - ENTRY PANEL.                         
  215.                                                                                 
  216.                                                                                 
  217.      3.2) Enter the name of your Pascal program at the "MEMBER ===>"            
  218.           prompt.  Press return and your program will be displayed at           
  219.           the terminal.                                                         
  220.                                                                                 
  221.      3.3) Enter the command "SUBT A,10" at the "COMMAND ===>" prompt of         
  222.           this panel and press return to submit your program to the system.     
  223.           The operating system assign a jobname comprised of your userid        
  224.           suffixed with the letter A followed by a job number.  The response    
  225.           from the operating system will resemble the lines below:              
  226.                                                                                 
  227.           IKJ56250I JOB useridA(JOBnumber) SUBMITTED                            
  228.           ***                                                                   
  229.           Memorize the number inside the parentheses.                           
  230.                                                                                 
  231.                                                                                 
  232.                                                                                 
  233. EJECT                                                                           
  234.           SECTION FOUR : Accessing your output:                                 
  235.                                                                                 
  236.      4.1) At the "COMMAND ===>" prompt, type =3.8 to go to OUTLIST UTILITY      
  237.           PANEL.                                                                
  238.                                                                                 
  239.                                                                                 
  240.                                                                                 
  241.    -------------------- OUTLIST UTILITY ----------------------------------      
  242.    OPTION ===>                                                                  
  243.                                                                                 
  244.       L - List job name/id's via the TSO STATUS command                         
  245.       D - Delete job output from SYSOUT hold queue                              
  246.       P - Print job output and delete from SYSOUT hold queue                    
  247.       R - Requeue job output to a new output class                              
  248.       blank - Display job output                                                
  249.                                                                                 
  250.    FOR JOB TO BE SELECTED:                                                      
  251.       JOBNAME ===> Userid                                                       
  252.       CLASS   ===>                                                              
  253.       JOBID   ===> J01977                                                       
  254.                                                                                 
  255.    FOR JOB TO BE REQUEUED:                                                      
  256.       NEW OUTPUT CLASS ===>                                                     
  257.     * DESTINATION      ===>                                                     
  258.                                                                                 
  259.    FOR JOB TO BE PRINTED:               (A for ANSI)                            
  260.       PRINTER CARRIAGE CONTROL ===>     (M for machine)                         
  261.                                         (blank for none)                        
  262.        * - Georgia State University Enhancement                                 
  263.           Press return to see your output.                                      
  264.                                                                                 
  265.                                                                                 
  266.      4.2) Use the TAB key to tab to the "JOBNAME ===>" prompt.  Here, type      
  267.           your userid, followed by the letter "A" (or the jobname suffix        
  268.           entered earlier).                                                     
  269. EJECT                                                                           
  270.      4.3) Next, tab down to the "JOBID ===>" prompt, and type the letter "J     
  271.           followed by the job number you memorized earlier.  Then, hit          
  272.           return to see your job output.  To scroll down, use the F8 key,       
  273.           and to scroll up, use the F7 key.  To scroll left and right,          
  274.           use the F10, and F11 keys respectively.                               
  275.           Below is a similar facsimile of a successful Pascal execution a       
  276.           viewed from the OUTLIST UTILITY menu.                                 
  277.                                                                                 
  278.    BROWSE - USGHND.DAY.SPF235.OUTLIST ------------ LINE 000000 COL 001 080      
  279.    COMMAND ===>                                            SCROLL ===>HALF      
  280.    ********************************** TOP OF DATA ************************      
  281.    1                    J E S 2  J O B  L O G  --  S Y S T E M  G S U 1  --  N O
  282.    0                                                                            
  283.     11.12.36 JOB 2185  ICH70001I USGHND   LAST ACCESS AT 11:09:25 ON TUESDAY, OC
  284.     11.12.36 JOB 2185  $HASP373 USGHNDX  STARTED - INIT  A - CLASS A - SYS GSU1 
  285.     11.12.45 JOB 2185  -                                                --TIMING
  286.     11.12.45 JOB 2185  -JOBNAME  STEPNAME PROCSTEP    RC   EXCP   CONN    CPU   
  287.     11.12.45 JOB 2185  -USGHNDX  PASC                      00   332   1851    .0
  288.    0                                                                            
  289.     11.12.45 JOB 2185  -USGHNDX  LKED                 00    332   1851    .00   
  290.     11.12.45 JOB 2185  -USGHNDX  GO                   00    332   1851    .00   
  291.     11.12.45 JOB 2185  -USGHNDX  ENDED.  NAME-USGHND  /\       TOTAL CPU TIME=  
  292.     11.12.46 JOB 2185  $HASP395 USGHNDX  ENDED        ||                        
  293.    0------ JES2 JOB STATISTICS ------                 ||                        
  294.    - 18 OCT 88 JOB EXECUTION DATE                     ||-------------------     
  295.    -         9 CARDS READ                             | A RETURN CODE (RC)      
  296.    -       152 SYSOUT PRINT RECORDS                   | OF ZERO MEANS YOUR      
  297.    -         0 SYSOUT PUNCH RECORDS                   | PROGRAM EXECUTED        
  298.    -         8 SYSOUT SPOOL KBYTES                    | WITHOUT ERRORS.         
  299.    -      0.17 MINUTES EXECUTION TIME                 |                         
  300.        1     //USGHNDX   JOB I994998,USGHND,          |--------------------     
  301.              //     NOTIFY=USGHND,CLASS=A,MSGLEVEL=(1,1),                       
  302.              //     USER=USGHND,TIME=(0,5)                                      
  303.                                                                                 
  304.                                                                                 
  305.                                                                                 
  306.      4.4) To look at your output file, type =2 at the "COMMAND ===>" prompt     
  307.           When you are in the EDIT - ENTRY PANEL, type the name of your         
  308.           output file (OUTDATA in our case) in the "TYPE ===>" prompt.          
  309.           Then, hit return to see your output file.                             
  310.                                                                                 
  311.    SECTION FIVE: Logging off.                                                   
  312.                                                                                 
  313.                                                                                 
  314.           To logoff, enter =X at the "COMMAND ===>" or "OPTION ===>"            
  315.           prompt of any panel.  Once the operating system displays the
  316.           message READY, you may then type the command LOGOFF.
  317.           At this point you will be disconnected from the system.
  318.                                                                                 
  319.    IMPORTANT NOTE:                                                              
  320.                                                                                 
  321.           The program, input and output files that you have created are         
  322.           saved in the system.  Therefore subsequent executions should          
  323.           reference sections 3.1 through 4.4.                                   
  324.                                                                                 
  325. EJECT                                                                           
  326.                                                                                 
  327.                     COMMONLY USED FEATURES OF THE FILE EDITOR                   
  328.                                     ISPF/PDF                                    
  329.                                                                                 
  330.       PROGRAM                                                                   
  331.    FUNCTION KEYS               NOTE: The more frequently used keys have         
  332.                                      been marked with an asterisk               
  333.      F1     HELP                                                                
  334.      F2     SPLIT SCREEN                                                        
  335.    * F3     END                                                                 
  336.      F4     RETURN                                                              
  337.      F5     RFIND                                                               
  338.      F6     RCHANGE                                                             
  339.    * F7     UP SCREEN                                                           
  340.    * F8     DOWN SCREEN                                                         
  341.      F9     SWAP                                                                
  342.    * F10    LEFT SCREEN                                                         
  343.    * F11    RIGHT SCREEN                                                        
  344.      F12    CURSOR                                                              
  345.                                                                                 
  346.    ------------------------------------------------------------------------     
  347.                                                                                 
  348.                                                                                 
  349.       ISPF/PDF                                                                  
  350.        MENUS                                                                    
  351.                                                                                 
  352.    * =2     EDIT                                                                
  353.      =3.1   DELETE MEMBERS                                                      
  354.      =3.2   DELETE DATA SETS                                                    
  355.      =3.4   GET LISTING OF ALL DATA SETS                                        
  356.      =3.6   GET PROGRAMS OF DATA FILES SENT TO PRINTER                          
  357.    * =3.8   DISPLAY OR PRINT JOB OUTPUT                                         
  358.                                                                                 
  359.    * =X     EXIT OR LOGOFF SYSTEM   (then type: logoff)                         
  360.                                                                                 
  361.                                                                                 
  362.    ------------------------------------------------------------------------     
  363.                                                                                 
  364.                       KEYBOARD NOTES                                            
  365.                                                                                 
  366.    *****      WHENEVER PROMPTED WITH '***' PRESS RETURN         *****           
  367.    *****      IF PROMPTED WITH "READY" TO GET BACK ON THE       *****           
  368.    *****      SYSTEM TYPE "ICF", OR IF YOU ARE FINISHED         *****           
  369.    *****      TYPE "LOGOFF".                                    *****           
  370.                                                                                 
  371.    *****      IF KEYBOARD FREEZES, PRESS THE TAB KEY            *****           
  372.    *****      IF STILL FROZEN, PRESS THE return key             *****           
  373.    *****      IF STILL FROZEN, PRESS CNTL G                     *****           
  374.    *****      IF KEYBOARD IS STILL LOCKED UP, PRESS ALT 2       *****           
  375.    *****      IF KEYBOARD IS STILL LOCKED UP, PRESS ALT 1       *****           
  376.                                                                                 
  377.    ------------------------------------------------------------------------     
  378.